import request from '@/utils/request'

// 查询用药记录列表
export function listMedication(query) {
  return request({
    url: '/user/medication/list',
    method: 'get',
    params: query
  })
}

// 查询用药记录详细
export function getMedication(orderId) {
  return request({
    url: '/user/medication/' + orderId,
    method: 'get'
  })
}

// 新增用药记录
export function addMedication(data) {
  return request({
    url: '/user/medication',
    method: 'post',
    data: data
  })
}

// 修改用药记录
export function updateMedication(data) {
  return request({
    url: '/user/medication',
    method: 'put',
    data: data
  })
}

// 删除用药记录
export function delMedication(orderId) {
  return request({
    url: '/user/medication/' + orderId,
    method: 'delete'
  })
}
